<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Onboard-SDK-ROS: DJI::onboardSDK::HardDriver Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Onboard-SDK-ROS
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceDJI.html">DJI</a></li><li class="navelem"><b>onboardSDK</b></li><li class="navelem"><a class="el" href="classDJI_1_1onboardSDK_1_1HardDriver.html">HardDriver</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classDJI_1_1onboardSDK_1_1HardDriver-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">DJI::onboardSDK::HardDriver Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a4bd7d6bcbb708b905e6296f3d1ac9eab"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDJI_1_1onboardSDK_1_1HardDriver.html#a4bd7d6bcbb708b905e6296f3d1ac9eab">init</a> ()=0</td></tr>
<tr class="memdesc:a4bd7d6bcbb708b905e6296f3d1ac9eab"><td class="mdescLeft">&#160;</td><td class="mdescRight">After calling this function, <a class="el" href="classDJI_1_1onboardSDK_1_1HardDriver.html">HardDriver</a> should be able to read and send correctly, through a correct UART part.  <a href="#a4bd7d6bcbb708b905e6296f3d1ac9eab">More...</a><br /></td></tr>
<tr class="separator:a4bd7d6bcbb708b905e6296f3d1ac9eab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a8e5a1d10b8f3f33f3e4a683661539c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6a8e5a1d10b8f3f33f3e4a683661539c"></a>
virtual time_ms&#160;</td><td class="memItemRight" valign="bottom"><b>getTimeStamp</b> ()=0</td></tr>
<tr class="separator:a6a8e5a1d10b8f3f33f3e4a683661539c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a618b229205cca01a1a8571a4ff02bf11"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a618b229205cca01a1a8571a4ff02bf11"></a>
virtual size_t&#160;</td><td class="memItemRight" valign="bottom"><b>send</b> (const uint8_t *buf, size_t len)=0</td></tr>
<tr class="separator:a618b229205cca01a1a8571a4ff02bf11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6315d9b57f5af0fb248a162185d36e19"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6315d9b57f5af0fb248a162185d36e19"></a>
virtual size_t&#160;</td><td class="memItemRight" valign="bottom"><b>readall</b> (uint8_t *buf, size_t maxlen)=0</td></tr>
<tr class="separator:a6315d9b57f5af0fb248a162185d36e19"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8dc3cee8ac1490a5b7a1b5446515f7cc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8dc3cee8ac1490a5b7a1b5446515f7cc"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>lockMemory</b> ()=0</td></tr>
<tr class="separator:a8dc3cee8ac1490a5b7a1b5446515f7cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a175faa535f2c278e25dbb683dcdfa179"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a175faa535f2c278e25dbb683dcdfa179"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>freeMemory</b> ()=0</td></tr>
<tr class="separator:a175faa535f2c278e25dbb683dcdfa179"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae40233a230aae298004fe1b92f68679b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae40233a230aae298004fe1b92f68679b"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>lockMSG</b> ()=0</td></tr>
<tr class="separator:ae40233a230aae298004fe1b92f68679b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1ff91f12f1ac4a5dcf8301d44c6d2d9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae1ff91f12f1ac4a5dcf8301d44c6d2d9"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>freeMSG</b> ()=0</td></tr>
<tr class="separator:ae1ff91f12f1ac4a5dcf8301d44c6d2d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a98d8e8ee10a64dcd880f694f6cf6b137"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a98d8e8ee10a64dcd880f694f6cf6b137"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>displayLog</b> (const char *buf=0)</td></tr>
<tr class="separator:a98d8e8ee10a64dcd880f694f6cf6b137"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a4bd7d6bcbb708b905e6296f3d1ac9eab"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void DJI::onboardSDK::HardDriver::init </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>After calling this function, <a class="el" href="classDJI_1_1onboardSDK_1_1HardDriver.html">HardDriver</a> should be able to read and send correctly, through a correct UART part. </p>
<dl class="section note"><dt>Note</dt><dd>How to use In order to provide platform crossable <a class="el" href="namespaceDJI.html">DJI</a> onboardSDK library, we abstract this class as a hardware level.</dd>
<dd>
function descriptions:</dd></dl>
<p>void <a class="el" href="classDJI_1_1onboardSDK_1_1HardDriver.html#a4bd7d6bcbb708b905e6296f3d1ac9eab" title="After calling this function, HardDriver should be able to read and send correctly, through a correct UART part. ">init()</a>; unsigned int getTimeStamp(); returns a TimeStamp data in unit msec. The difference between the return value of the function call two times is the excat time between them in msec.</p>
<p>size_t send(const uint8_t *buf, size_t len); return sent data length.</p>
<p>size_t readall(uint8_t *buf, size_t maxlen) = 0; return read data length.</p>
<p>void lockMemory();/ void freeMemory(); provide a mutex for multi-thread. when operating memory.</p>
<p>void lockMSG();/ void freeMSG(); provide a mutex for multi-thread. when operating messages.</p>
<p>void displayLog(char *buf); Micro "API_LOG" invoked this function, to pass datalog. In order to pass data through different stream or channel. We abstract this virtual function for user. And different from others, this interface is not a pure virtual funcion. The default data-passing channel is stdout (printf). See also "DJI_HardDriver.cpp".</p>
<dl class="section attention"><dt>Attention</dt><dd>when writting and reading data, there might have multi-thread problems. Abstract class <a class="el" href="classDJI_1_1onboardSDK_1_1HardDriver.html">HardDriver</a> did not consider these issue. Please be careful when you are going to implement send and readall funtions.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>we strongly suggest you to inherit this class in your own file, not just implement it in DJI_HardDriver.cpp or inside this class </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>dji_sdk_lib/include/dji_sdk_lib/<a class="el" href="DJI__HardDriver_8h_source.html">DJI_HardDriver.h</a></li>
<li>dji_sdk_lib/src/DJI_HardDriver.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Jul 1 2016 12:37:59 for Onboard-SDK-ROS by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
